﻿package
{
	public class Special_Commands
	{
		var ACE:String = " A";
		var KING:String = " K";
		var QUEEN:String = " Q";
		var JACK:String = "  J";
		
		var picard:String = "\n" +
		"                                            ________\n" +
		"                                    , -**                   **~ ,\n" +
		"                             , -*                                   *- ,\n" +
		"                         ,/                                               *:,\n" +
		"                     ,?                                                      \,\n" +
		"                   /                                                           ,}\n" +
		"                 /                                                      ,:*^*  }\n" +
		"               /                                                   ,:*         /\n" +
		"              ?     __                                         :*           /\n" +
		"             /__ (     *~-,_                              ,:*          /\n" +
		"           /(_    *~,_        *~,_                    ,:*        _/\n" +
		"          {  _$;_      *=,_       *-,_       , -~-,}, ~*;/    }\n" +
		"           ((     *~_       *=- _      *;,, /*    /*              /\n" +
		"   ,,,___ \*~,      *~ ,                    *     }              /\n" +
		"            (    *=-,,       *                        (      ;_,,-*\n" +
		"            / *~,      *-                               \      /\\\n" +
		"             \*~ *-,                                     |, /     \,__\n" +
		",,_          } >- _\                                   |              *=~-,\n" +
		"     *=~-,_\_      *\,                                 \\\n" +
		"                   *=~-,, \,                               \\\n" +
		"                                *:,,                           *\              __\n" +
		"                                     *=-,                   ,%*>--==**\n" +
		"                                        _\           _,-%       *\\\n" +
		"                                   ,<*  _|_,-&**                *\\"
	
		var facepalm:String = "\n" +
		"                    ,-~*’`¯lllllll`*~,\n" +
		"              ,-~*`llllllllllllllllllllll¯`*-,\n" +
		"         ,-~*lllllllllllllllllllllllllllllllll*-,\n" +
		"      ,-*llllllllllllllllllllllllllllllllllllllll\\\n" +
		"    ;*`lllllllllllllllllllllllllll,-~*~-,lllllll\\\n" +
		"     \\lllllllllllllllllllllllllll/         \\;;;;lll,-`~-,\n" +
		"      \\lllllllllllllllllllll,-*           `~-~-,   ( (¯`*,`,\n" +
		"       \\llllllllllll,-~*                     )_-\\  *`*;  )\n" +
		"        \\,-*`¯,*`)            ,-~*`~                /\n" +
		"         |/   /   /~,      -~*,-~*`;                / \\\n" +
		"        /   /   /   /  ,-,  *~, `*~*                *   \\\n" +
		"       |   /   /   / *`   \\                           )    )¯`~,\n" +
		"       | /   /    /       )      , )`*~-,            /    |  )   `~-,\n" +
		"      / /   /   ,*`-,     `-,   *`    ,---      \\    /     /  |         ¯```*~-\n" +
		"      (          )`*~-,    `*` ,-~* ,-*      |   /    /   /            \\\n" +
		"       *-,       `*-,   `~,  `` ,,,-*          | ,*   ,*   |      \\\n" +
		"          *,         `-,   )-,              ,-*`   ,-*    (`-,   \n"
		
		var ackbar:String = "\n" +
		"                                                                        _________\n" +
		"                                                                       / It’s a trap! \\\n" +
		"                                _,,,--~~~~~~~~--,_        \\  _________/\n" +
		"                            ,-‘ : : : :::: :::: :: : : : : :º ‘-,     \\/                   \n" +
		"                         ,-‘ :: : : :::: :::: :::: :::: : : :o : ‘-,                    \n" +
		"                      ,-‘ :: ::: :: : : :: :::: :::: :: : : : : :O ‘-,                  \n" +
		"                   ,-‘ : :: :: :: :: :: : : : : : , : : :º :::: :::: ::’;                \n" +
		"                 ,-‘ / / : :: :: :: :: : : :::: :::-, ;; ;; ;; ;; ;; ;; ;\\                \n" +
		"                /,-‘,’ :: : : : : : : : : :: :: :: : ‘-, ;; ;; ;; ;; ;; ;;|              \n" +
		"              /,’,-‘ :: :: :: :: :: :: :: : ::_,-~~,_’-, ;; ;; ;; ;; |              \n" +
		"          _/ :,’ :/ :: :: :: : : :: :: _,-‘/ : ,-‘;’-‘’’’’~-, ;; ;; ;;,’                \n" +
		"      ,-‘ / : : : : : : ,-‘’’ : : :,--‘’ :|| /,-‘-‘--‘’’__,’’’ \\ ;; ;,-‘                \n" +
		"      \\ :/,, : : : _,-‘ --,,_ : : \\ :\\ ||/ /,-‘-‘x### ::\\ \\ ;;/                    \n" +
		"        \\/ /---‘’’’ : \\ #\\ : :\\ : : \\ :\\ \\| | : (O##º : :/ /-‘’                      \n" +
		"        /,’____ : :\\ ‘-#\\ : \\, : :\\ :\\ \\ \\ : ‘-,___,-‘,-`-,,                      \n" +
		"        ‘ ) : : : :’’’’--,,--,,,,,,¯ \\ \\ :: ::--,,_’’-,,’’’¯ :’- :’-,                  \n" +
		"         ) : : : : : : ,, : ‘’’’~~~~’ \\ :: :: :: :’’’’’¯ :: ,-‘ :,/\\                  \n" +
		"         \\,/ /|\\\\| | :/ / : : : : : : : ,’-, :: :: :: :: ::,--‘’ :,-‘ \\ \\                \n" +
		"         \\\\’|\\\\ \\|/ ‘/ / :: :_--,, : , | )’; :: :: :: :,-‘’ : ,-‘ : : :\\ \\,              \n" +
		"       /¯ :| \\ |\\ : |/\\ :: ::----, :\\/ :|/ :: :: ,-‘’ : :,-‘ : : : : : : ‘’-,,_        \n" +
		"      | : : :/ ‘’-(, :: :: :: ‘’’’’~,,,,,’’ :: ,-‘’ : :,-‘ : : : : : : : : :,-‘’’\\\\        \n" +
		"  ,-‘ : : : | : : ‘’) : : :¯’’’’~-,: : ,--‘’’ : :,-‘’ : : : : : : : : : ,-‘ :¯’’’’’-,_  \n" +
		" / : : : : :’-, :: | :: :: :: _,,-‘’’’¯ : ,--‘’ : : : : : : : : : : : / : : : : : : :’’-,\n" +
		"/ : : : : : -, :¯’’’’’’’’’’’¯ : : _,,-~’’ : : : : : : : : : : : : : :| : : : : : : : : :\n" +
		" : : : : : : :¯’’~~~~~~’’’ : : : : : : : : : : : : : : : : : : | : : : : : : : : :';\n";		
		var slap:String = "\n" +
		"                       __\n" +
		"                __  (__) __\n" +
		"               (__)l     l(__)  __\n" +
		"               l    l l    l l    l (__)\n" +
		"               l = l l = l l = l l = l       ####   #            ###      ####     #\n" +
		"               l    l l    l l    l l    l       #         #           #     #    #     #     #\n" +
		"      __     l = l l = ll = l l = l      ####    #           ####     ####     #\n" +
		"     l]   \\   l                  l l = l           #     #          #     #    # \n" +
		"      l      ) l                         l     ####    ####   #      #    #            #\n" +
		"      (     (/                          l\n" +
		"       \\                                 l\n" +
		"         \\                               l\n" +
		"          \\                             /\n" +
		"            \\                         /\n" +
		"              l                       l\n"
		
		var bird:String = "\n" +
		"                       __\n" +
		"                      (__)\n" +
		"                      l    l\n" +
		"                      l    l \n" +
		"                      l = l \n" +
		"      __       __ l    l  __\n" +
		"     l]   \\   l = l l = ll = l __\n" +
		"      l      ) l                  ll = l\n" +
		"      (     (/                          l\n" +
		"       \\                                 l\n" +
		"         \\                               l\n" +
		"          \\                             /\n" +
		"            \\                         /\n" +
		"              l                       l\n";
		
		
		function scanString(input:String):String
		{
			var tempString:String = input;
			var madeChange:Boolean = true;
			
			while (madeChange)
			{
				var oldString:String = tempString;
				
				//Check for picards
				tempString = tempString.replace("/picard", picard);
			
				//Check for facepalms
				tempString = tempString.replace("/facepalm", facepalm);
				
				//Check for ackbars
				tempString = tempString.replace("/ackbar", ackbar);
				tempString = tempString.replace("/trap", ackbar);
			
				//Check for slap
				tempString = tempString.replace("/slap", slap);
				
				//Check for bird
				tempString = tempString.replace("/bird", bird);
				
				//Check for genCard
				tempString = tempString.replace("/genCard", generateCard());
				
				if (oldString == tempString)
				{
					madeChange = false;
				}
			}
			
			return tempString;
		}
		
		function generateCard():String
		{
			var tempString:String = "\n" +
			" _____\n" +
			"|          |\n" +
			"| " + generateSuit() + " " + generateVal() + " |\n" +
			"|_____|\n";
			
			return tempString;

		}
		
		function generateSuit():String
		{
			var tempVal:int = Math.floor(Math.random() * 4);
			
			if (tempVal == 0)
			{
				return "♥";
			}
			if (tempVal == 1)
			{
				return "♦ ";
			}
			if (tempVal == 2)
			{
				return "♣";
			}
			if (tempVal == 3)
			{
				return "♠";
			}else
			{
				return "";
				trace("out of range");
			}
		}
		
		function generateVal():String
		{
			var tempVal:int = Math.floor(Math.random() * 13) +2;
			
			if (tempVal < 10)
			{
				return "  " + tempVal;
			}
			if (tempVal == 10)
			{
				return "10";
			}
			if (tempVal == 11)
			{
				return JACK;
			}
			if (tempVal == 12)
			{
				return QUEEN;
			}
			if (tempVal == 13)
			{
				return KING;
			}
			if (tempVal == 14)
			{
				return ACE;
			}else
			{
				return "";
				trace("out of range");
			}
		}
	}
}